---
title: Activity Detection
description: Activity Detection feature explanation and example
---

The activity detection feature is responsible for notifying you when any of your
watched events has been triggered, regardless of whether or not it will result in
a change of idle state.

### Properties

The properties associated with activity detection are:

{/* cspell:disable */}
- [events](/docs/api/props#events): The events to listen for activity on.
- [element](/docs/api/props#element): The DOM element to bind event listeners to.
- [onAction](/docs/api/props#onaction): Function called each time an event is triggered.
- [throttle](/docs/api/props#throttle): Throttle the `onAction` callback in milliseconds.
- [debounce](/docs/api/props#debounce): Debounce the `onAction` callback in milliseconds.
- [startOnMount](/docs/api/props#startonmount): Bind the events when the host component mounts. Defaults to `true`.
- [startManually](/docs/api/props#startmanually): Require a call to `start()` in order to bind the events initally.
{/* cspell:enable */}

### Methods

The methods associated with activity detection are:

{/* cspell:disable */}
- [start](/docs/api/methods#start): Binds the events.
- [pause](/docs/api/methods#pause): Unbinds events.
- [resume](/docs/api/methods#resume): Rebinds events.
- [getElapsedTime](/docs/api/methods#getelapsedtime): Returns the ammount of milliseconds since the host component was mounted.
{/* cspell:enable */}

### Example
<CodeSandbox name='activity-detection-tmn5bp' />
